package org.decorator.ex2.eg2;

import java.util.Date;

public class GroupPrizeDecorator extends Decorator{

	public GroupPrizeDecorator(Component c) {
		super(c);
	}
	
	public double calcPrize(String user, Date begin, Date end){
		
		double money = super.calcPrize(user, begin, end);
		double group = 0.0;
		
		for (double d : TempDB.mapMothSaleMoney.values()) {
			group += d;
		}
		
		double prize = group * 0.01;
		System.out.println(user + " 当月团队业务奖金 " + prize);
		return money + prize;
	}

}
